#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>

int main(void)
{
	int fd;
	int led_cmd;
	fd = open("/dev/led_drv", O_RDWR);
	if(fd < 0)
	{
		perror("open");
		exit(1);
	}

	while(1)
	{
		led_cmd = 1;
		write(fd, &led_cmd, sizeof(led_cmd));
		sleep(1);
		
		led_cmd = 0;
		write(fd, &led_cmd, sizeof(led_cmd));
		sleep(1);
	}
	close(fd);
	return 0;
}
